fixed login loop