added &nbsp; to createCharNode method