update ajax code and login code