Added support for redirecting files