Fixing functionality in the User class