fix environment reloading bug introduced by TCO