bug fix. use str_replace instead of substr.