fixed problems found in code review