fixed sparse bug