fix for cursors on composite queries