fixed db and unit tests