Write after end
Attempting to write to a stream that has already ended.
Check if stream is ended before writing. Handle stream events properly. Use stream.on('end') to detect when stream ends.