fixing improper testing of client connectivity and removing reference cell