Fix undeclared variable error when using older browser