Added redirect to main on successful login