added support for custom directories