setups environment data and args.   fixed #8