fix a bug for tabs