Fixed login so it redirects to target page after login