add cancel connection judement