Editing post gives 502 bad gateway error