Fix login code