add use strict and fix global variable