added redirect to last visited page after login