fix empty text bug in output