fixed DB bug