Correct bad query issue when insert link