fixed static vars bug