Fix tab overwriting bug when rotating screen