fix header and add debug