Added more event handlers for debugging