fixing some bug where the auth header may be undef