fixing orphan tab elements