Incorrect function nesting
Write stream to file