fixed some code in logincontroller