Added automatic redirection when user is not logged in