script now also downloads type