fix open database