added iterator for cursor
fixed cursor