Ethercard not working after first request

I loaded the rbbb server example into my arduino and it worked fine, the I loaded other examples for servos and other sensors I have, but when I tried the rbb server again it won’t work again. It will send back a webpage once only if I have a Serial.print() inside the loop, I have no idea why…

Here is the modified version I’m using:

// This is a demo of the RBBB running as webserver with the Ether Card
// 2010-05-28 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php

#include <EtherCard.h>

// ethernet interface mac address, must be unique on the LAN
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
static byte myip[] = { 192,168,0,30 };

byte Ethernet::buffer[500];
BufferFiller bfill;

void setup () {
  Serial.begin(9600);
  if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
    Serial.println(F("Failed to access Ethernet controller"));
  ether.staticSetup(myip);
  
  ether.printIp("My IP: ", ether.myip);
  ether.printIp("Netmask: ", ether.netmask);
  ether.printIp("GW IP: ", ether.gwip);
  ether.printIp("DNS IP: ", ether.dnsip);
}

static word homePage() {
  long t = millis() / 1000;
  word h = t / 3600;
  byte m = (t / 60) % 60;
  byte s = t % 60;
  bfill = ether.tcpOffset();
  bfill.emit_p(PSTR(
    "HTTP/1.0 200 OK\r\n"
    "Content-Type: text/html\r\n"
    "Pragma: no-cache\r\n"
    "\r\n"
    "<meta http-equiv='refresh' content='1'/>"
    "<title>RBBB server</title>" 
    "<h1>$D$D:$D$D:$D$D</h1>"),
      h/10, h%10, m/10, m%10, s/10, s%10);
  return bfill.position();
}

void loop () {
  word len = ether.packetReceive();
  word pos = ether.packetLoop(len);
  
  Serial.print(pos); // server wont send answer without this print here, but it still will only serve the homepage once, browser will timeout
  if (pos) {  // check if valid tcp data is received
    char *data = (char *) Ethernet::buffer + pos;
    Serial.println();
    Serial.println(data);
    
    ether.httpServerReply(homePage()); // send web page data    
  }  
}

Without that print I never get a response on the browser, with the print I get one response but then the browser times off. This is crazy and I need help.