Added code for delaying animation until page load