fixing a bug when going to page 2