moved getMax Value out of role