move class view to function view
return to index page if login refuse