Fix cursor focus bug