added before and after processing to deleteConnection