added more checks for corrupted data