fixing trigger bug