change hashmap equals for non pointer types