Adding excption handling in todo