corrected validation method