fixed semantic errors
merged