added events function