redirection function fixes