fixed some bugs in the initial provisioning