error validation working