added some functionality for client thread