Fixed to a working fallback javascript

Previous script isn't working when offline. Silly me.