Add timeout loop during ajax request