add missing #include for algorithm