fixed static variables issue after register