fixed bug: passed wrong code to POST request