Fixed codes in pagination