Use share func from https://stackoverflow.com/a/59515229/3390