fix bug when using curl, cannot convert object to primitive value