Corrected validation for scriptdirectory