fixed resultJSON length undefined bug