Changed way of binding event

Changed way of binding event