String alterations not responding as expected