JS changes for device detection