Fixed a bug with left and right arrows in pagination