validation works for calling class objects