Fixed error in using model validation on server-side