added support for dir