Anurag: modified login code