Fix client undefined bug