add error handling to hamming compute