update login method, make it ajax