fixing file redirection