fix how to get dir in script