fixed no attribute error method and tests