fixed null entry bug (cd with no target dir)