first tab wasn't properly closed because its index is '0' and was wrongly dealt with as None