remove debug log
fix some memory leaks