Add isDirectory as parameter to callback