adds some resilience if there is some garbage in the data for some unknown reasons