Testing and fixinng pagination