added some environment checks