patch from Phil for dist