adding in validation for the -d argument