adding a test for not overwriting the state after the task is finished