modified the generated script so that it can be executed from any directory