added guards for bad responses, fixed q name errors