issues fixed and create trigger