Fix wrong posts start and end index when paging