Fix Register bug