fixed the segfault for hash function, (int) was causing a negative num to be returned