added environment detection
changed file permission