fix database max wait time in event handler