fix issue with db acquire and release