JavaScript tab initialization fix