There is a small style bug here, it should be `if(inited) {` (without the space after the `if`).