implemented save events in db