fixed bug in POST, PUT