login now redirects propperly to main