fixed stream closing