modify createDirectoryAtPath method