implemented promises in the clent