Added function to cancel a request