Bugfix: properly check for failed response