add check for nil data in CalculateHash()