even better last page detection
moar debug output