fix  bugs during registering