fixed bug when user was not logged in