fix decode function which was not updated to new JSON code