can only malloc this array after workspace query