added possibilty to close cient