prepare script error handling revision