Fixes bug with Prev and next page