fixes database bug