updated output writer