added null check for _type and for console for IE