changed logic in the hashobj function