fixed stream close fn