added some login control and register control