Fixed a bug that crashed the application upon refresh due to pagination