fix wraparound issue
make script path absolute