Allows stream to be closed