fix db cursor problem caused by yield