fixed max deprecation warning

WARNING: max(x) is deprecated, use maximum(x) instead.