Added ability to return directories in mapping