bug fix on checking destination dir/file