make sure shell is only finalized once