Task Cancellation

Task Cancellation
Also, I think this is kind of code convention. Instead of doing
```java
try {
    // code
} catch (IOException e) {
    // code
}
```

We should follow the style of the project, which is:
```java
try {
    // code
}
catch (IOException e) {
    // code
}
```
I also think the **Exception** caught should be specific, so **IOException** is more specific than just **Exception**. 

The same applies for ```if-else``` statement, which we are following:
```java
if (condition) {
    // code
} 
else if (anotherCondition) {
    // code
}
else {
    // code
}
```

These comments let us achieve more readability. Thank you.