Do not  crash if on_close fails