fix memory leak caused by bind