Corrected syntax related bug and added top_dir