bug fix with cookie authentication.
Bug workaround with certain queries