Fix cursor in DB