This method will be called in almost every cases. Should we do that?
Usually inIndex has integer value and it rarely have smaller than 0 or bigger than panels.length.