fixes bug messing up the header