fix a mistake in refactoring
show error if character is deleted