issue of not-calling-online/offline should be fixed

it was because it lost the reference to "this" and was using "document"
and "document" had no method "updatemode"