Fix bug on hash check