handle invalid task states
Merge branch 'hs_staging' into hs_stable