fixed stupid bug in refactor