added replace functions to deal with the ra-gha/sha issue