fix bug caused by refratoring