Damn, never knew about that headers_sent() function LW, nice one!