Fix db bug. This is a stable version