fix spark bug