fixed db detection