Add isDirectory method