divide pages sliding algorithm bugfixed