Fixed error on panel display + converting index of clicked tab to int