fixed the setTimeOut method