Fix reference error with limit