Fixed cancel edit functionality