fixed -d option when dir arg isn't the cwd