fixed index redirection logic. cleaned up login