Fix problem that $client is undef on parent side