Added error-catching to to-do list