Add Output Buffering Control to avoid "http headers have already been sent" errors