fixed NPE when connection is not found