Added the general validation method