Fix BUG in pagination