Fixed server login logic