Found a better way to escape strings with states.