How to change string in local scope