validation done through class