Fix bug in that the json sent to post is incorrect