Added keep-alive checking during the directory-touching loop at