fixed cross-browser issues in headerOnLoad