Modified client to work for select()