added error message for unexpected script result