fixed login hook