fixed with tests