few bug modified.(when logined, should redirect_to root_path)