Fix error_msg in fetch_records script