making virtual function to record events