close modal on error