make heap immutable, error handling, fix while

- fix discarding env after condition evaluation in while