FORGE-874: Using PreStartup and added a safe check in ForgeEnvironment