Fixing script to work with jenkins