fix bug if user is not logged in