fix "icon is undefined" javascript error