changed / to be loginpage (login currently not needed). Added checks to login process.