Set ajax url as variable and removed second ajax attempt.