added test
fixed top_dir option bug