Hacky attempt to avoid close error.