categories fix and adding pagination