Adding event controller