use handleEvent to process all functions