minor
memory leak check and minor
minor