Fix json which is given to javascript