fix logic for adding new tasks and saving existing tasks