added bidirectional option to allow unidirectional disconnections