fixed DB implementation