Changed which to test -e