Added error-handling to todo list