more stable (bug fix), user UID saved in global var