Sentence repeat element replacement is working but needs some error-handling.