added trigger
fixed bug