added close method to unsubscribe from client