quit the loop when there is no json object