implemented validation