Added support for directories