fix clause and empty cursor next