fix some bugs in provisioning shell scripts