fix storing the whole ast in the constructor