patch an issue with script determining its own directory