Bugs and edit event

fixed edit event and other bugs