Fixed bug with setting inital db