fix departments pagination error