added setTimeout to onresize event