wrapped getTypeName() in a try/catch block as its using might result in TypErrors sometimes when using 'use strict';