update to fix event firing of update/update end

Fix for event handling on update and update end. Also moved update to before the appendBuffer call to distinguish the two events.