Settign proper result code on cancel