fixed code example for cancelling requests