Adding editing function