use events correctly