added db events to avoid deadlocks