fixed cursor to support limit properly.