correct implementation of client