use map instead of map pointer