fixed idxmax errors