bug fix for env in script and raw modules