Use -f instead of -d to check for file