updated login example with ajax