add cursor, add function on cursor, some fixed