fixed unclosed resources