Properly handle paged param in query