fix bug refactoring v2