implemented ajax authentication