better handling of downloadState