prevent NPE when there is no connection