urgent bugfix -- json.loads does not work with IO objects