small change to make the script more robust.