Set ajax url as variable and removed secons ajax attempt.