fixing the bug in delete connection where the connection was "Ref" type