gs-device-detection code added