fixed db crash