bug fix for max value from table i removed the having max command and put the max aggrigator in the select it self