added close statements for ostr objects