fixed crashes when cancelling handles