Cleaning up frames using json.dumps