fix bug in 8th big refactoring