Why var Class = empty function, but tests success