Implemented validation inside model