Small adjustment on DB function