convert to state machine
setAnchorByString