fixed storing and calling of map procedure