fix offline code