added a checking if the user is not logged in