handle invalid task states