fixed rate limit header issue, fixed some undefined variable notices