update the checkHash function