move limit into query