changing redirection logic