fixed semantic issues due too refactoring