$class should have been declared - see my commit