header wrong logic fix