fix bugs, appers after global substitute.