implemented redirection to referer after login