fix potential overrun when getting LED mode