update event logic, not yet finished.