fix reset with casting