used variable instead of hardcoded olddir