Was only replacing the first quote, and was not escaping the backslash it was tring to give.