replace deprecated max -> maximum