Changed AddTab and AddLine to use Invoke only when required