trigger is not working properly
index off by 1