fixed broken edge trigger, and added parameter validation