check for a directory