[BUGFIX] handle exception when headers is None