add some code for register and main page