add tm at end of func