adding missing brackets, and making sure content is utf8 encoded