fixed editing function