performance and event handler fix