fixed method for setting headers