re-coding for logincontroller