fix a critical bug for event handling of ui components