fix attach panic