fix the bug and refactoring