add some logic flow