improved json decode workaround, necessary for some tomcat versions