redirection bugs fixed