Adding support for redirecting to previous page upon login