fix bug where user is not logged in