Add create event and fix other bugs