Fix cursor db access