added validations to trains model