Check for valid directory