modified ajax for login