fixed a bug in calling chooseJSON