added functionality for user to close server streaming and client