enhance function getPos; add insert char