thread error fixed

if getCommandCount<=0 then thread error fixed