Fixed error in editing functionality.