Fix Critical Bug

fix high cpu and ram usage