fixed file redirection, hopefully