fixed some memory leak with commitment and channel