moving the setTimeout around