add go online/offline function