bugfix in adaptalgorithm