Add enviroment checking.