Fixed DB handling