change the loginCheck function in User class to static