added code for editing records