changed the API to not insertAtCharIndex when the key is delete