add pagination concern and improve error message handling