add use strict, fix global variable