handle record events, and display errors. Not yet working (see code).