small changes, freeing some streams