updated to perform string escape for content going into queries