setting up proper functionality in events