Fixed IndexOutOfRange Exception

Fixed IndexOutOfRange exception when there's no selectable widgets