make script more backwards compatible