fix bug in offline mode