Fixed a bug after registration