added code to check that device is on home network