use setTimeout as method of window