consider using(client) at the beginning instead of client.Dispose.