more appropriate way to update registry