fix client with check null params before foreach