bugfix for next and previous page