fix stream and template