fix variable declaration bug, and create game only after document.DomContentLoaded is fired