added a proper redirect after logging in