fix init code in chrome 31