autoclose popup on error