Added more validation and a trigger