changed code to redirect users to profile page once logged in