Working on adding Local variable, not work yet
minor fixing leak memory