modified Login function and History file with Nazar