fixed logic of method validation