Use EXISTS rather than IS_DIRECTORY