refactored to include the response from the script