modify command existence check with if [ -x ... ]