fixed references to wrong object and used late static binding