fixing model validation