fixes issue with environment check throwing multiple errors and triggering multiple callback