Fixing pagination class issue