fix algorithm selection