Fixed undefined isn't a function throw in browser