changed edit logic