used by client