added paginated query class