memory corruption after deleteing the hash