updated to use -e in place of -d