Fix cursor return wrong position