Fixing pages loops