Fixed crash for repeated instances

- crash fixed, inputs cleared after reasoning ends
- table cleared after reasoning end