Fixed bug with headers not loading in proper scope