handle incorrect JSON better