Fixed bug in hash method