fix replace logic of openLink