Added pagination support