fixed the script run so that it can be called from anywhere