Fixed the segfault caused by hash map