Added basic support for goOffline/goOnline, probably buggy and certainly not clean