fixed static variable bug