[UPDATE] corrected the redirection if user is not logged in