Fixing login code