Add add_suffix helper function and some bug fix