fixed bug in tests also fixed database