fix NPE when offline, fixes #31