Fixed a Bug on Register