fixed a bug in hash