Added more control for loading state
Prevented initial animation from playing when the page loading time is too long