Use instance_exec to fix event losing issue