Use command -v instead of which.