tasks: fixed app crash when changing state of non-existing task