close modal if no errors