added support for external files