Only add a limit to the query if the limit is greather than 0