Fixed saving task in addObject. Should be saved after receiving instance number rather than before.