Fix cursor sync bug