dump to disk before recur call to prevent stackoverflow