Damn i could have saved myself a lot of time. Seems that i was cleaning the wrong cache. I was cleaning "clean all FE cache" (red) expecting that this one cleans all cache. For some stupid reason this doesn't clean everything and it doesn't include the 'green' cache clean option. the str_replace function is effective.