added code to save completed registrations