If anyone has this similar problem the solution for me was to correctly format set timeout, before I was doing setTimeout(function() {//program here}, 5000) but that did not wor