edit cost fix errors