fixed #265; missing code during refactor