throw an Exception when header is already been sent