fix semantic errors