added togglebutton for offline mode