updated str_replace to be more specific to stop additional matches