added online/offline logic
added config