fix event/delegate bug and rebuild widget