optimize update display and fix deleting text element issue