update ts logic