added redirect logic to login