added setDeviceType function