fixed bugs, carry in addvaluestohash()