but when i do bar = new Class() and try to call bar.foo() it errors