Add error handling to access ranking