environment support

improve environment support