improving the server login code