Fixed edit functionality