Added update functionality and more validation.