now actually handles events