safer hashmap