Added validation to the todo model