Update script to work in any environment