fix mapping bugs