replace setinterval with settimeout, fix #1