fixed some issues with mapping