add free for avoiding memory leak