add log and assert for NLP