added error checking to todo list