Move event listener for offline event

Needs to be added after deviceready