Added redirect if not logged in and logout