fix bug when insert new snippet