move source_dir to attribute