fixed a small refactor bug