Properly cancel connection