changed error showing and model saving