redirects to dashboard if user logged in and redirects to home is user is not logged in