improvement on setinterval management into stats