stopping links if no connection detected
added setTimeout so that buttons can click while scrolling