prevent setRequestHeaders from being called twice