Add support for directories as input