Added cancelled operation handling

Fixed exception when cancelling the download