refactor by creating initialize function
fix bug
create and use resetFavicon.