add mention function
fix corner cases for mentionFunction