created a mechanism that verifys if users are logged in