fixing a bug with hash computation