Put limit on inner query