JS changes for device detection part 2