Fix error on console trying to get user from undefined