fixed a bug with setting text to nil