Fix dispose exception