updated paginated directive to use a more flexible query object