fixed the token replacement