handling click event to remove pairs