changed is_file to is_dir