replace validation from controller to model