bugs modification after refactoring 2