fixed semantic errors