fixing error when user not loged in