Added error handling to strings and checking for escaped chars