handle SSJS environments too