Fix bug with tasks not saving properly