fix main loop and timer after assets loading