Modified exception for dir.