in avoid of 'index out of range'