fix validation to display error messages.