Move self.emit outside of the try block (look #228)