removed ambiguous call to max