added env parameter to device