fixes bug where queries from locahost would cause 400 response