try to handle json on the js side