fixed semantics issues