fix offline bug