fixed bug about switch mapping