implemented validation method