added a little fix in device.js