fix bugs of using Map