Added Environment detection
Added Environment detection