switched style of offline detect, and added permission for network