Fixed error in cursors