Fixed bug when using json body encoding