Made it adapt to the right class