small bug of using incorrect variable when checking for user login status