fix one potential memory leak. make header file cleaner