Re-fixes DB transactions

Re-fixes DB transactions