Moved response out of if clause