Fixing bug in hash