mayank - min max query compile errors removed