Added login ajax logic