Changed variables to a StringIO first, then convert to string
Need to import StringIO
Changed a stupid HTML error