fixed mention-end logic