relocated scripts out of subdir
Fixed environment variable check