added flash message for model errors