added redirect if not logged in