2427 Adds check for length of lastPage array instead of undefined or empty string