Added editrecord function