add support for passing directories