restored maxDepth & fileName defaults & closed a resource leak warning