fixed bug when linit=true