fixed small refactoring bug