move dom code out of addStatus function