added verification and test for malformed data