fixed sd for non-directory argument