db: fixed some mess