Recursive added mode. Fixed memory leak issues.