fixing signal width for max_idx