bug fiixes; added client functionality