fixed retain cycles and event handling