fixes local replacement

fixed #38