protect emit and close