added support for setting type of record and fixed non-matching records with same name being deleted