fix bug caused by code completion optimize