wrong using of setInterval was fixed.