elastic search fixes and better error logging