add events correctly