Fix crash issue due to empty surrounding_text