Fixed stream mismatch issue