added support for new tasks and updating existing ones too