redirect to home if not logged in and show flash message implemented