added check for word boundary to alias replacement