updated edit code