Fix crash when select number out of range