Fix bug in event controller