replace timer with setinterval