rewrite dtport with bind&function