Added events function