add client logic + fixes