add hashmap and buffer