it works with cursors